<!-- 用户列表 -->
<style>
	th {
		text-align: center;
	}
	
	.table>tbody>tr>td {
		line-height: 30px;
		text-align: center;
		height: 30px;
		margin: 0px;
	}
</style>
<div id="data_page" class="in_page">
	
		<div class="panel panel-default">
			<div class="panel-body">
				<form class="form-inline"  method="get" name="keyword" id="keyword">
					<div class="form-group">
					属性管理
					</div>
					<div class="form-group" style="float: right;">
						<button type="button" class="btn btn-sm btn-primary link" onclick="addNewManager(this)">添加属性</button>
					</div>
				</form>
			</div>
		</div>
		
	<table class="table table-striped table-bordered table-condensed  ">
		<thead>
			<tr>
				<th>属性</th>
				<th>库存数量</th>
				<th>差价</th>
				<th>操作</th>

			</tr>
		</thead>
		<tbody>
			<volist name="res" id="li">
				<tr>
					<td>{$li.name}</td>
					<td width="100px" >{$li.num}</td>
					<td width="100px" >{$li.dif}</td>
					<td width="190px">
                        <a href="{:U('update_product_attr', array('id'=>$li['id']))}">
                            <button type="button" class="btn btn-sm btn-success" >修改</button>
                        </a>
						<button type="button" class="btn btn-sm btn-danger link" link="{:U('Product/del_product_attr')}?id={$li.id}&pid={$id}">删除</button>
					</td>
				</tr>
			</volist>
		</tbody>
	</table>

<div class="modal fade" id="user-add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		 <div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="myModalLabel">添加属性</h4>
			</div>
			<div class="modal-body">
				<form id="bjy-form" class=" form-horizontal" action="{:U('Product/add_product_attr')}" method="post">
					<input type="hidden" name="id" value="{$id}" />
					<div class="form-group">
					 <label for="title" class="col-sm-2 control-label">属性名:</label>
					<div class="col-sm-6">
						<input type="text" class="form-control" name="name" />
					</div>
					</div>
					<div class="form-group">
					 <label for="title" class="col-sm-2 control-label">库存数量:</label>
					<div class="col-sm-6">
						<input type="text" class="form-control" name="num" />
					</div>
					</div>
					<div class="form-group">
					 <label for="title" class="col-sm-2 control-label">差价:</label>
					<div class="col-sm-6">
						<input type="text" class="form-control" name="dif" />
					</div>
					</div>
					<div class="form-group">
					 <div class="col-sm-offset-2 col-sm-10">
						 <button type="submit" class="btn btn-primary button">提交</button>
					</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>


</div>
<script language="javascript">
function addNewManager(obj){
	$('#user-add').modal('show');
	
}

</script>